<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
    <!-- 全屏 -->
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <!-- 上方栏显示 -->
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <!-- 不自动识别号码 -->
    <meta name="format-detection" content="telephone=no">
    <!-- Include js plugin -->
    <title>登录</title>
    <link rel="stylesheet" href="/static/wap/skin/css/layout.css">
    <link rel="stylesheet" href="/static/wap/skin/css/demos.css">
    <link rel="stylesheet" href="/static/wap/skin/css/logreg.css">
    
    <link rel="stylesheet" href="/static/wap/weui/css/weui.min.css">
    <link rel="stylesheet" href="/static/wap/weui/css/jquery-weui.min.css">
    <script src="/static/wap/weui/js/jquery.min.js"></script>
    <script src="/static/wap/weui/js/jquery-weui.min.js"></script>
    <script src="/static/wap/skin/js/demos.js"></script>
</head>
<body>
<header class="brB">
	<div class="h_top">
    	<div class="hLeft"><a href="javascript:;" class="icoH icoReturn mt20"></a></div>
    	<div class="hCenter"><span class="tit c-3ac9af">登入</span></div>
    </div>
</header>
<div class="warp">
    <div class="fix b-FFFFFF LH60 oh p30">
            <ul class="mt10">
                <li class="ptb20 brB">
                	<div id="zh" class="layout-box layAccur">
                        <div class="pr40">账号</div>
                        <div class="box-col"><input class="noText" id="mobile" type="text" placeholder="请输入手机号码"></div>
                        <div id="zh_error" style="display:none" class="icoWrong">!</div>
                        <div id="zh_right" style="display:none" class="icoWrong">&rfloor;</div>
                    </div>
                </li>
                <li class="ptb20 brB">
                	<div id="ps" class="layout-box layAccur">
                        <div class="pr40">密码</div>
                        <div class="box-col"><input class="noText" id="pass" type="password" placeholder="请输入6-20位密码"></div>
                        <div id="ps_error" style="display:none" class="icoWrong">!</div>
                        <div id="ps_right" style="display:none" class="icoWrong">&rfloor;</div>
                    </div>
                </li>
            </ul>
            <div id="prompt" class="layout-box mt20"></div>
            
			<div class="layout-box mt20">
                <a href="javascript:login_submit();" class="box-col b-DDDDDD r10 LH80 tac">登录</a>
        	</div>
            <div class="lh2">
            	<a class="c-40d064" href="/reg">快速注册</a>
            	<a class="c-ffaa3b r" href="#">忘记密码</a>
            </div>
            
    </div>
</div>
<script>
function login_submit(){
var m = $("#mobile").val();
var pw = $("#pass").val();;   
if(m == ""){
    document.getElementById('prompt').focus();
    //document.getElementById('zh').setAttribute("class", "layout-box layError"); 
    document.getElementById('prompt').innerHTML='手机号码不能为空！';
    return false;
}
if(pw == ""){
    document.getElementById('pass').focus();
    document.getElementById('prompt').innerHTML='密码不能为空！';
    return false;
}
    $.ajax({
        type: "POST",
        url: "/login/index",
        data: {mobile:m,pwd:pw},
        dataType: "json",
        success: function (data) {
            if(data == 1){
                self.location='/'; 
            }else{
                document.getElementById('prompt').innerHTML=data;
            }
        }
    });
}

$("#mobile").blur(function(){
    var m = $("#mobile").val();
    if(m == ""){
        $("#zh").attr("class", "layout-box layError");
        $("#zh_error").show();
        $("#zh_right").hide();
    }else{
        $("#zh_error").show();
        $("#zh_right").hide();
    }
    
    //$("#zh_error").hide();
});

$("#mobile").focus(function(){
    var m = $("#mobile").val();
    if(m != ""){
        $("#zh").attr("class", "layout-box layAccur");
        $("#zh_error").show();
    }else{
        $("#zh").attr("class", "layout-box layAccur");
        $("#zh_error").hide();
    }
});

$("#pass").blur(function(){
    var pw = $("#pass").val();;  
    if(pw == ""){
        $("#ps").attr("class", "layout-box layError");
        $("#ps_error").show();
        $("#ps_right").hide();
    }else{
        $("#ps_error").show();
        $("#ps_right").hide();
    }
    
    //$("#zh_error").hide();
});

$("#mobile").focus(function(){
    var pw = $("#pass").val();
    if(pw != ""){
        $("#ps").attr("class", "layout-box layAccur");
        $("#ps_error").show();
    }else{
        $("#ps").attr("class", "layout-box layAccur");
        $("#ps_error").hide();
    }
});
</script>
<!-- body 最后 -->

</body>
</html>